#!/bin/bash


#获取磁盘大小
disk_num=$(lsblk -o NAME,SIZE,TYPE,MOUNTPOINT | grep disk)
disk_total=$(lsblk -o NAME,SIZE,TYPE,MOUNTPOINT | grep disk | awk '{sum += $2} END {print sum}')

# 输出json结果
echo "CPU核数: $cpu_num"
echo "总内存: $mem_total"
echo "磁盘数量: $disk_num"
echo "磁盘大小: $disk_total"

